package com.yunhe.control;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.swing.RepaintManager;

import com.yunhe.bean.ShopPingJia;
import com.yunhe.bean.ShopUser;
import com.yunhe.service.pingjiaService;

/**
 * Servlet implementation class showpingjia
 */
@WebServlet("/qian/ShowPingJia.do")
public class ShowPingJia extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public ShowPingJia() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		this.doPost(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		request.getSession().setAttribute("sid", request.getParameter("sid"));
		String sname = new String(request.getParameter("sname").getBytes("iso8859-1"),"utf-8");
		request.getSession().setAttribute("sname",sname);
		List<ShopUser> su = new pingjiaService().showPingjia();		
		
		HttpSession session = request.getSession();
		
		session.setAttribute("showping", su);
		
		request.getRequestDispatcher("info.jsp").forward(request, response);
		

	}

}
